#include <stdio.h>
#include <assert.h>

//verstion 2
//using pointer
int strlen(const char *str)
{
  const char *ptr = str;
  while(*ptr != '\0')
    ++ptr;
  return ptr-str;
}

int main(int argc,char *argv[])
{
  char str[] = "";
  assert(argc == 2);
  printf("%d\n",strlen(argv[1]));

  assert(strlen("") == 0);
  assert(strlen(" ") == 1);
  assert(strlen(str) == 0);
  assert(strlen("123abc") == 6);

  return 0;
}
